﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TrainingRequest.Models.TraningsRequestsExt>" %>
<%@ Import Namespace="TrainingRequest.Models" %>

<br />
<div>Участники:</div>
<div><br />
<% 
    Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdTrainingsParticipants";
                                        settings.KeyFieldName = "IdTrainingsParticipant";
                                        settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsParticipantPartial" };
                                        settings.SettingsPager.PageSize = 20;
                                        //settings.Settings.ShowFilterRow = true;
                                        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
                                        settings.Width = 500;
                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = "Имя";
                                            column.FieldName = "ParticipantName";
                                        });

                                        settings.Columns.Add(column =>
                                        {
                                            column.Caption = "Должность";
                                            column.FieldName = "ParticipantPosition";
                                        });

                                    }).Bind(Model.ParticipantsList).GetHtml();
%>
</div>


<% using (Html.BeginForm("AddRequestParticipantsPartial"))
   { %>
    <%: Html.ValidationSummary(true) %>
    <div class="editor-label"> Имя </div>
    <div class="editor-field">
        <%:
            @Html.DevExpress().TextBox( settings => 
                {
                    settings.Name = "ParticipantItem.ParticipantName";
                    settings.Width = 500;
                    settings.Properties.NullText = "Введите имя участника...";
                }).GetHtml()
        %>
    </div>
      
      
    <div class="editor-label"> Должность </div> 
    <div class="editor-field">
        <%:
            @Html.DevExpress().TextBox( settings => 
                {
                    settings.Name = "ParticipantItem.ParticipantPosition";
                    settings.Width = 500;
                    settings.Properties.NullText = "Введите название должности...";
                }).GetHtml()
        %>
    </div>

    <%--<input type="submit" value="Добавить участника" />--%>

    <br /><button type="submit" value="Добавить участника">Добавить участника</button>
<% } %>

